HopeTIME / [timerd] 腾讯、爱奇艺、芒果、优酷、乐视、B站、土豆、搜狐、暴风、1905等 VIP视频免费看(2019-06-24)更新

// ==UserScript==
// @name         [timerd] 腾讯、爱奇艺、芒果、优酷、乐视、B站、土豆、搜狐、暴风、1905等 VIP视频免费看(2019-06-24)更新
// @namespace    http://timerd.ml
// @version      0.16
// @description  腾讯、爱奇艺、芒果、优酷、乐视、B站、土豆、搜狐、暴风、1905等各大视频网站视频解析服务, 没有广告!
// @author       timerd
// @include      *://v.youku.com/v_*
// @include      *://m.youku.com/v*
// @include      *://m.youku.com/a*
// @include      *://*.iqiyi.com/v_*
// @include      *://*.iqiyi.com/w_*
// @include      *://*.iqiyi.com/a_*
// @include      *://*.iqiyi.com/dianying/*
// @include      *://*.le.com/ptv/vplay/*
// @include      *://*v.qq.com/x/cover/*
// @include      *://*v.qq.com/x/page/*
// @include      *://*v.qq.com/play*
// @include      *://*v.qq.com/cover*
// @include      *://*.tudou.com/listplay/*
// @include      *://*.tudou.com/albumplay/*
// @include      *://*.tudou.com/programs/view/*
// @include      *://*.tudou.com/v*
// @include      *://*.mgtv.com/b/*
// @include      *://film.sohu.com/album/*
// @include      *://tv.sohu.com/*
// @include      *://*.bilibili.com/video/*
// @include      *://*.bilibili.com/anime/*
// @include      *://*.bilibili.com/bangumi/play/*
// @include      *://*.pptv.com/show/*
// @include      *://*.baofeng.com/play/*
// @include      *://*.wasu.cn/Play/show*
// @include      *://*.1905.com/play/*
// @require      http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @grant        GM_openInTab
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @grant        unsafeWindow
// @grant        GM_getResourceURL
// @grant        GM_getResourceText
// @license      MIT
// ==/UserScript==
(function () {

    'use strict'
    // Define region
    //-------------------------------------------------------------
    function sleep(d) {
        for (let t = Date.now(); Date.now() - t <= d;);
    }

    function addInfrastructure(isMQQ) {
        let style = document.createElement("style");
        if (isMQQ) {
            style.appendChild(document.createTextNode(`
            #mywidget a {
            position: absolute;
            left: -80px;
            transition: 0.3s;
            padding: 15px 15px;  
            text-decoration: none;
            color: white!important;
            border-radius: 0 5px 5px 0;
            font: 20px "Microsoft YaHei",SimHei,helvetica,arial,verdana,tahoma,sans-serif;
            height: 60px!important;
            width: 130px!important;
           
          }`));
        }
        else {

            style.appendChild(document.createTextNode(`
              #mywidget a {
              position: absolute;
              left: -80px;
              transition: 0.3s;
              padding: 15px;  
              text-decoration: none;
              color: white!important;
              border-radius: 0 5px 5px 0;
              font: 20px "Microsoft YaHei",SimHei,helvetica,arial,verdana,tahoma,sans-serif;
              height: 38px;
              width: 100px;
             
            }`));

        }

        style.appendChild(document.createTextNode(`    
    #mywidget a:hover {
      left: 0;
    }    
    
    #vparse {
      background-color: #f44336;
    }

    #mywidget a img {
    width: 28px;
    height:34px;
    position: absolute;
    top:16px;
    right: 5px;
    align-items: center;
    }`));
        document.head.appendChild(style);
    }

    //-------------------------------------------------------------
    let playurl = window.location.href;
    let rArray = playurl.split('?');
    let cWeb = rArray[0];
    const vSite = /m1907.cn/i;
    const qqMobile = /m.v.qq.com/i;
    //-------------------------------------------------------------

    // Little tricks 
    window["alert"] = function (e) { };
    if (vSite.test(cWeb)) {
        window["alert"] = function (e) { };
        sleep(3000);
        return;
    }
    //------------------------------------------------------------

    //add a button to current website.
    addInfrastructure(qqMobile.test(cWeb));
    var vWebsites = new Array();
    vWebsites[0] = /youku.com/i;
    vWebsites[1] = /iqiyi.com/i;
    vWebsites[2] = /le.com/i;
    vWebsites[3] = /qq.com/i;
    vWebsites[4] = /tudou.com/i;
    vWebsites[5] = /mgtv.com/i;
    vWebsites[6] = /sohu.com/i;
    vWebsites[7] = /1905.com/i;
    vWebsites[8] = /bilibili.com/i;
    vWebsites[9] = /pptv.com/i;
    vWebsites[10] = /baofeng.com/i;
    vWebsites[11] = /yinyuetai.com/i;
    vWebsites[12] = /wasu.cn/i;
    vWebsites.every((item) => {
        if (item.test(cWeb)) {
            var jumpButton = $(`
            <div id="mywidget" href='javascript:void(0)' target='_blank' style="z-index:9999; position:fixed;left:0px;top:280px;">    
                <a href="#" id="vparse">视频解析<img  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIoAAAEABAMAAACe9fNdAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAACpQTFRFAAAA/////////////////////////////////v7+////////////////f9kpNAAAAA50Uk5TAFBv/5+AkGAgt69woLCQiK2eAAADi0lEQVR4nM3WzXEaYRCEYXRyAEpAObAXlVGVc1AICsVh+OYIFMIXmkEI2P12frp75mACeOptCmb3cHh6OTR8npcO5f34q0XpiHk/dsSclYaYs9IQc1HqMRelHvNxbIj5cTw2xPy+KsWY75ZqzEdLzHtLzE15felQapvuSmnTQ6nEPJRKzEopxKyUQsxa0WPWih6zUeSYjSLHbBU1ZquoMZMixkyKGDMrWsysaDE7RYrZKVLMXlFi9ooSYyjCITcUYZOl8JtMhY4xFTrGVtgYW2FjHIWMcRQyxlO4GE/hYlyFinEVKsZXmBhfYWIChYgJFCImUvCYSMFjQgWOCRU4JlbQmFhBYxIFfKokCrgpU7BNqQLFpAoUkytITK4gMYACxAAKEIMoeQyi5DGQksZAShqDKVkMpmQxoJLEgEoSgypxDKrEMbASxsBKGIMr0SHHlWgToQSbGMWPYRQ/hlLcGEpxYzjFi+EUL4ZUnBhScWJYxY5hFTuGVswYWjFjeMWK4RUrRlCMGEExYhRlH6Mox78tym6TpsybNGWOEZWlRZliVGVpUbYxsrK0KJsYXVlalHVMQVlalFVMRVlalEdMSVlalHtMTVlalFtMUVlalO+YqnJ9I68q101l5WtTXVlalEtMg/LzP1JGh3Jq+XZHh3Jq+dWNDuXU8W98++xQRsd9ObVczNGh3FJqyuhQ7iklZXQoj5SKMjqUVUpBGR3KOkVXRoeySZGV0aFsU1RldChTiqiMDmVOkZTXzw5l3iMpuz2Ssk8RFCNFUIwUXrFSeMVKoRUzhVbMFFaxU1jFTiEVJ4VUnBRO8VI4xUuhFDeFUtwURvFTGMVPIZQgBVf2J1tRgj24Eu3BlTAFVeIUVIlTQCVJAZUkBVOyFEzJUiAlTYGUNAVR8hREyVMABUgBFCAlV5CUXEFSUgVKSRUoJVOwlEzBUhIFTImV8OkBK+CeWEH3xAqcEil4SqTgKYFCpAQKkeIrTIqvMCmuQqW4CpXiKVyKp3ApjkKmOAqZYitsiq2wKaZCp5gKnWIpfIqhvKEnO1QGj+wVYY+hKCk7RUrZKVLKrGgps6KlTIqYMiliylZRU7aKmrJR5JSNIqesFT1lregpK6WQslIKKQ+lkvJQKil35U8FuSmlPXdldCjFlG+lmHJVqilXpZrypZRTvpRyykWpp1yUespZaUg5K6NBee5IOTwJb07z5x8vsz6yIYOSJgAAAABJRU5ErkJggg=="></img>  </a>
            </div>
            `);
            jumpButton.hide();
            $("body").append(jumpButton);
            jumpButton.show();
            return false;
        }
        return true;
    });


    // bind onclick event
    $("#mywidget").click(function () {
        window.open('https://chinese-elements.com/static/v.html?zwx=' + playurl);
    });
})();